﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace paper.evisa99.com.Controllers
{
    public class HomeController : Controller
    {
        Class.Kore kore = new Class.Kore();
        ///=============================================================================
        public string Index()
        {
            Response.Redirect("/Home/test");
            return DateTime.Now.ToString();
        }
        ///=============================================================================
        public ActionResult NoAllowed()
        {

            return View();
        }
        ///=============================================================================
        public ActionResult Test()
        {
            if (Request.UrlReferrer == null)
            {
                ViewBag.GrabUrl = "about:blank";
            } else
            {
            ViewBag.GrabUrl = Request.UrlReferrer.ToString ();
            }
            ViewBag.CONN = System.Configuration.ConfigurationManager.ConnectionStrings["AdoConnection"].ToString();
            ViewBag.DB_VER = Class.DB.Ver;
            ViewBag.AUTH_VER = Class.Authority.Ver;
            return View();
        }
        ///--------------------------------------------------------------------------------------------
        public string TestKey(string id, string id2, string id3, string key)
        {
            if (key == "evisa99")
            {
                return Class.Authority.GenKey(id + id2 + id3);
            } else
            {
                return "keyerr";
            }
        }
        ///--------------------------------------------------------------------------------------------
        public string TestID(string key)
        {
            if (key == "evisa99")
            {
                return kore.CreateID("TT");
            } else
            {
                return "keyerr";
            }
        }
        ///=============================================================================
    }
}
